From: Stefano Stabellini Date: Thu, 13 Dec 2012 11:44:01 +0000 (+0000) Subject: xen/arm: use strcmp in device_tree_type_matches X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~7526 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success/%22http:/www.example.com/cgi/success?a=commitdiff_plain;h=b232542c277228312e35b2a71e0f8dbb35854099;p=xen.git xen/arm: use strcmp in device_tree_type_matches We want to match the exact string rather than the first subset. Signed-off-by: Stefano Stabellini Acked-by: Ian Campbell Committed-by: Ian Campbell --- diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 7a072cb930..8b4ef2f45c 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -44,14 +44,13 @@ bool_t device_tree_node_matches(const void *fdt, int node, const char *match) bool_t device_tree_type_matches(const void *fdt, int node, const char *match) { - int len; const void *prop; - prop = fdt_getprop(fdt, node, "device_type", &len); + prop = fdt_getprop(fdt, node, "device_type", NULL); if ( prop == NULL ) return 0; - return !strncmp(prop, match, len); + return !strcmp(prop, match); } bool_t device_tree_node_compatible(const void *fdt, int node, const char *match)